package appconf

import "github.com/spf13/viper"

type Appconfig struct {
	Mysql
	Redis
}
type Mysql struct {
	User     string
	Password string
	Host     string
	Port     int
	Database string
}
type Redis struct {
	Password string
	Host     string
	Port     int
	Database string
}

var Appconf Appconfig

func Init() {
	viper.SetConfigFile("appconf/dev.yaml")
	err := viper.ReadInConfig()
	if err != nil {
		panic(err)
	}
	viper.Unmarshal(&Appconf)

}
